import request from '@/utils/request'

// 查询项目费用列表
export function listDealExpense(query) {
  return request({
    url: '/dealExpense/dealExpense/list',
    method: 'get',
    params: query
  })
}

// 查询项目费用列表
export function getDealExpenseSum(query) {
  return request({
    url: '/dealExpense/dealExpense/getSum',
    method: 'get',
    params: query
  })
}

export function listDealExpenseByResult(query) {
  return request({
    url: '/dealExpense/dealExpense/listByResult',
    method: 'get',
    params: query
  })
}

export function getDealExpenseSumByResult(query) {
  return request({
    url: '/dealExpense/dealExpense/getSumByResult',
    method: 'get',
    params: query
  })
}

// 查询项目费用详细
export function getDealExpense(id) {
  return request({
    url: '/dealExpense/dealExpense/' + id,
    method: 'get'
  })
}

// 保存项目费用
export function saveDealExpense(data) {
  return request({
    url: '/dealExpense/dealExpense/save',
    method: 'post',
    data: data
  })
}

// 删除项目费用
export function delDealExpense(id) {
  return request({
    url: '/dealExpense/dealExpense/' + id,
    method: 'delete'
  })
}

// 删除项目费用明细
export function delDealExpenseDetail(id) {
  return request({
    url: '/dealExpense/dealExpense/detail/' + id,
    method: 'delete'
  })
}

// 导出项目费用
export function exportDealExpense(query) {
  return request({
    url: '/dealExpense/dealExpense/export',
    method: 'get',
    params: query
  })
}

// 维护付款时间
export function updatePayTime(id, payCompletionTime) {
  const data = {
    id,
    payCompletionTime
  }
  return request({
    url: '/dealExpense/dealExpense/updatePayTime',
    method: 'post',
    data: data
  })
}
